package me.stephenj.experiment2.model;

import java.util.HashMap;

public class Personj {
    private int ID;
    private String FirstName;
    private String LastName;
    private HashMap<String, Integer> PhoneNrs;
    private HashMap<String, String> Mails;
    private String Pics;
    private HashMap<String, String> Company;

    public Personj(Person person) {
        this.ID = person.getID();
        this.FirstName = person.getFirstName();
        this.LastName = person.getLastName();
        this.Pics = person.getPics();
        PhoneNrs = new HashMap<>();
        Mails = new HashMap<>();
        Company = new HashMap<>();
    }

    public int addPhoneNr(PhoneNr phoneNr) {
        try {
            String name = phoneNr.getName();
            int number = phoneNr.getNumber();
            this.PhoneNrs.put(name, number);
            return 1;
        } catch (Exception e) {
            return 0;
        }
    }

    public int addMail(Mail mail) {
        try {
            String name = mail.getName();
            String address = mail.getAddress();
            this.Mails.put(name, address);
            return 1;
        } catch (Exception e) {
            return 0;
        }
    }

    public int addCompany(Company company) {
        try {
            String name = company.getName();
            String address = company.getAddress();
            this.Company.put(name, address);
            return 1;
        } catch (Exception e){
            return 0;
        }
    }

    public int getID() {
        return ID;
    }

    public void setID(int ID) {
        this.ID = ID;
    }

    public String getFirstName() {
        return FirstName;
    }

    public void setFirstName(String firstName) {
        FirstName = firstName;
    }

    public String getLastName() {
        return LastName;
    }

    public void setLastName(String lastName) {
        LastName = lastName;
    }

    public HashMap<String, Integer> getPhoneNrs() {
        return PhoneNrs;
    }

    public void setPhoneNrs(HashMap<String, Integer> phoneNrs) {
        PhoneNrs = phoneNrs;
    }

    public HashMap<String, String> getMails() {
        return Mails;
    }

    public void setMails(HashMap<String, String> mails) {
        Mails = mails;
    }

    public String getPics() {
        return Pics;
    }

    public void setPics(String pics) {
        Pics = pics;
    }

    public HashMap<String, String> getCompany() {
        return Company;
    }

    public void setCompany(HashMap<String, String> company) {
        Company = company;
    }
}
